import traceback
import requests


def do_request(method, url, params=None, data=None, json=None, headers=None, body=None, timeout=(10, 10)):
    for i in range(5):
        try:
            response = requests.request(method, url, params=params, data=data, json=json, headers=headers, timeout=timeout)
            return response
        except Exception:
            print(traceback.format_exc())
    return None
